/*
 * @Author: czy
 * @Date: 2021-04-29 14:25:59
 * @LastEditTime: 2021-05-21 22:03:12
 */
#include "string.h"

#include "api/system.h"

#include "stdlib.h"
#include "stdio.h"

/**
 * @description: Exit.
 * @param status	Exit code, default for 0.
 */
void exit(int status)
{
	printf("\nExit with code %d\n", status);
	shutdown();
}

/**
 * @description: Get the environment variable.
 * @param name	Name of environment variable.
 * @param value	Value of environment variable.
 * @return 1 for found, 0 for not found.
 */
int getenv(const char *name, char *value)
{
	return env(name, value);
}

/**
 * @description: Set the environment variable.
 * @param name	Name of environment variable.
 * @param value	Value of environment variable.
 * @return 1 for found, 0 for not found.
 */
int setenv(const char *name, const char *value)
{
	return export(name, value);
}

/**
 * @description: Add the environment variable.
 * @param name	Name of environment variable.
 * @param value	Value of environment variable.
 * @return 1 for found, 0 for not found.
 */
int addenv(const char *name, const char *value)
{
	return set(name, value);
}